#ifndef NEWPASSWORDDIALOG_H
#define NEWPASSWORDDIALOG_H

#include <QWidget>
#include <QDialog>
#include <QString>
namespace Ui {
class NewPasswordDialog;
}

class NewPasswordDialog : public QDialog
{
    Q_OBJECT

public:
    explicit NewPasswordDialog(QWidget *parent = nullptr);
    ~NewPasswordDialog();
    // 获取修改后的新密码
    QString getPassword()const;
private:
    // 密码验证
    bool checkPasswordEdit();
    // 验证成功, 返回 "", 失败返回失败原因.
    QString passwordValid(const QString& password);
private:
    void onEdittingFinished();

    void onSubmitBtnClicked();
private:
    Ui::NewPasswordDialog *ui;
    QString newPassword;
};

#endif // NEWPASSWORDDIALOG_H
